<template>
  <div class="techmap-container">
    <header class="page-header">
      <h1>技术地图</h1>
      <p class="subtitle">探索系统化的技术学习路径，助你成为全栈工程师</p>
    </header>

    <!-- 技术栈选择 -->
    <div class="tech-selector">
      <div class="tech-path active">
        <img src="https://placeholder.co/40" alt="Vue" class="tech-icon">
        <span>Vue 全栈开发</span>
      </div>
      <div class="tech-path">
        <img src="https://placeholder.co/40" alt="Spring" class="tech-icon">
        <span>Spring 全栈开发</span>
      </div>
      <div class="tech-path">
        <img src="https://placeholder.co/40" alt="Node.js" class="tech-icon">
        <span>Node.js 全栈开发</span>
      </div>
    </div>

    <!-- 学习路径图 -->
    <div class="learning-path">
      <!-- 前端基础 -->
      <div class="path-section">
        <h3 class="section-title">前端基础</h3>
        <div class="tech-cards">
          <div class="tech-card">
            <h4>Vue 3 基础</h4>
            <p>组件、生命周期、响应式系统</p>
            <div class="card-footer">
              <span class="time">预计时间: 2周</span>
              <button class="btn-start">开始学习</button>
            </div>
          </div>
          <div class="tech-card">
            <h4>TypeScript</h4>
            <p>类型系统、接口、泛型</p>
            <div class="card-footer">
              <span class="time">预计时间: 1周</span>
              <button class="btn-start">开始学习</button>
            </div>
          </div>
          <div class="tech-card">
            <h4>Vue Router & Pinia</h4>
            <p>路由管理、状态管理</p>
            <div class="card-footer">
              <span class="time">预计时间: 1周</span>
              <button class="btn-start">开始学习</button>
            </div>
          </div>
        </div>
      </div>

      <!-- 后端基础 -->
      <div class="path-section">
        <h3 class="section-title">后端基础</h3>
        <div class="tech-cards">
          <div class="tech-card">
            <h4>Node.js & Express</h4>
            <p>Web服务器、中间件、路由</p>
            <div class="card-footer">
              <span class="time">预计时间: 2周</span>
              <button class="btn-start">开始学习</button>
            </div>
          </div>
          <div class="tech-card">
            <h4>数据库设计</h4>
            <p>MySQL、MongoDB、数据建模</p>
            <div class="card-footer">
              <span class="time">预计时间: 2周</span>
              <button class="btn-start">开始学习</button>
            </div>
          </div>
        </div>
      </div>

      <!-- 进阶主题 -->
      <div class="path-section">
        <h3 class="section-title">进阶主题</h3>
        <div class="tech-cards">
          <div class="tech-card advanced">
            <h4>微服务架构</h4>
            <p>服务拆分、容器化、服务编排</p>
            <div class="card-footer">
              <span class="time">预计时间: 4周</span>
              <button class="btn-start">开始学习</button>
            </div>
          </div>
          <div class="tech-card advanced">
            <h4>DevOps实践</h4>
            <p>CI/CD、监控、日志管理</p>
            <div class="card-footer">
              <span class="time">预计时间: 3周</span>
              <button class="btn-start">开始学习</button>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- 学习资源推荐 -->
    <div class="resources-section">
      <h3>推荐学习资源</h3>
      <div class="resource-cards">
        <div class="resource-card">
          <div class="resource-icon">📚</div>
          <div class="resource-content">
            <h4>Vue 3 官方文档</h4>
            <p>最权威的Vue学习资源</p>
            <a href="#" class="resource-link">查看详情 →</a>
          </div>
        </div>
        <div class="resource-card">
          <div class="resource-icon">🎥</div>
          <div class="resource-content">
            <h4>视频教程合集</h4>
            <p>精选Vue全栈开发视频</p>
            <a href="#" class="resource-link">查看详情 →</a>
          </div>
        </div>
        <div class="resource-card">
          <div class="resource-icon">💻</div>
          <div class="resource-content">
            <h4>实战项目</h4>
            <p>手把手带你开发企业级应用</p>
            <a href="#" class="resource-link">查看详情 →</a>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
.techmap-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  text-align: center;
  margin-bottom: 3rem;
}

.page-header h1 {
  font-size: 2rem;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.subtitle {
  color: var(--gray-600);
}

.tech-selector {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.tech-path {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.tech-path:hover {
  border-color: var(--primary-200);
  background: var(--primary-50);
}

.tech-path.active {
  background: var(--primary-50);
  border-color: var(--primary-200);
  color: var(--primary-700);
}

.tech-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.path-section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.5rem;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
}

.tech-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.tech-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.2s;
}

.tech-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tech-card h4 {
  font-size: 1.1rem;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.tech-card p {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.tech-card.advanced {
  border-color: var(--primary-200);
  background: var(--primary-50);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.time {
  font-size: 0.875rem;
  color: var(--gray-600);
}

.btn-start {
  padding: 0.5rem 1rem;
  background: var(--primary-600);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-start:hover {
  background: var(--primary-700);
}

.resources-section {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 2rem;
}

.resources-section h3 {
  font-size: 1.5rem;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
}

.resource-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.resource-card {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: 8px;
  transition: all 0.2s;
}

.resource-card:hover {
  background: var(--primary-50);
}

.resource-icon {
  font-size: 2rem;
}

.resource-content h4 {
  font-size: 1rem;
  color: var(--gray-900);
  margin-bottom: 0.25rem;
}

.resource-content p {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.resource-link {
  color: var(--primary-600);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

.resource-link:hover {
  color: var(--primary-700);
}

@media (max-width: 768px) {
  .techmap-container {
    padding: 1rem;
  }
  
  .tech-selector {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
  }
  
  .tech-path {
    flex-shrink: 0;
  }
  
  .tech-cards {
    grid-template-columns: 1fr;
  }
  
  .resource-cards {
    grid-template-columns: 1fr;
  }
}
</style> 